<?php
/*
Plugin Name: B2主题-快速登录其他用户
Plugin URI: #
Description: #
Author: #
Author URI: https://gitee.com/jiangye123/b2-plugins
Version: 1.3
*/
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}
define( 'B2_QL_DIR', plugin_dir_path( __FILE__ ) );
define( 'B2_QL_URL', plugin_dir_url(__FILE__) );
define( 'B2_QL_ver', '1.2' );

//插件报错输出
add_action('activated_plugin',function($plugin_name){
    $out = '===================BEGIN===================='.PHP_EOL;
    $out .= 'Time   : '.date("Y/m/d H:i:s").PHP_EOL;
    $out .= 'Plugin :'.$plugin_name.PHP_EOL;
    $out .= 'Error: '.PHP_EOL;
    $out .= ob_get_contents();
    $out .= '=====================END===================='.PHP_EOL;
    file_put_contents(ABSPATH. 'plugin_activation.log', $out, FILE_APPEND);
});

//增加样式 js
add_action('wp_enqueue_scripts',function(){
    wp_enqueue_script( 'B2_QLjs', B2_QL_URL.'assets/style.js' ,array(), B2_QL_ver ,true );
    wp_enqueue_style( 'B2_QLcss', B2_QL_URL.'assets/style.css' ,array(), B2_QL_ver ,'all' );
},99);

add_action('wp_footer',function(){
    echo '<div id="b2ql" v-cloak>
        
    </div>';
});

require_once B2_QL_DIR.'rest.php';